<h1>Listing Stories</h1>

<table>
  <tr>
    <th>Author</th>
    <th>Title</th>
    <th>Issue</th>
    <th>Page</th>
    <th>Pages</th>
    <th>Summary</th>
    <th>Story type</th>
  </tr>

<% # TODO: paginate the story lists %>
<% for story in @stories %>
  <tr   class="<%= cycle('list-line-odd', 'list-line-even') %>">
    <td><%=h story.author.name %></td>
    <td><%=h story.title %></td>
    <td><%=h Issue.find(story.issue_id).description %></td>
    <td><%=h story.page %></td>
    <td><%=h story.page_count %></td>
    <td><%=h story.summary %></td>
    <td><%=h StoryType.find(story.story_type_id). name %></td>
    <td><%= link_to 'Show', story_path(story) %></td>
    <td><%= link_to 'Edit', edit_story_path(story) %></td>
    <td><%= link_to 'Destroy', story_path(story), :confirm => 'Are you sure?', :method => :delete %></td>
  </tr>
<% end %>
</table>

<br />

<%= link_to 'New story', new_story_path %>